package com.ch.home.bean;

import java.lang.reflect.Array;
import java.util.ArrayList;

/**
 * 菜馆菜品表
 * Created by CHEN on 2019/8/24.
 */
public class RestDish {

    private Integer id;
    private Integer restaurantId;
    private Integer dishId;
    private Integer status;

    private ArrayList<Dish> dishes;

    public RestDish(Integer id, Integer restaurantId, Integer dishId, Integer status, ArrayList<Dish> dishes) {
        this.id = id;
        this.restaurantId = restaurantId;
        this.dishId = dishId;
        this.status = status;
        this.dishes = dishes;
    }

    public RestDish() {

    }

    public RestDish(Integer id, Integer restaurantId, Integer dishId, Integer status) {

        this.id = id;
        this.restaurantId = restaurantId;
        this.dishId = dishId;
        this.status = status;
    }

    public Integer getId() {

        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getRestaurantId() {
        return restaurantId;
    }

    public void setRestaurantId(Integer restaurantId) {
        this.restaurantId = restaurantId;
    }

    public Integer getDishId() {
        return dishId;
    }

    public void setDishId(Integer dishId) {
        this.dishId = dishId;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public ArrayList<Dish> getDishes() {
        return dishes;
    }

    public void setDishes(ArrayList<Dish> dishes) {
        this.dishes = dishes;
    }

    @Override
    public boolean equals(Object o) {

        if (this == o) return true;
        if (o == null || getClass( ) != o.getClass( )) return false;

        RestDish restDish = (RestDish) o;

        if (id != null ? !id.equals(restDish.id) : restDish.id != null) return false;
        if (restaurantId != null ? !restaurantId.equals(restDish.restaurantId) : restDish.restaurantId != null)
            return false;
        if (dishId != null ? !dishId.equals(restDish.dishId) : restDish.dishId != null) return false;
        if (status != null ? !status.equals(restDish.status) : restDish.status != null) return false;
        return dishes != null ? dishes.equals(restDish.dishes) : restDish.dishes == null;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode( ) : 0;
        result = 31 * result + (restaurantId != null ? restaurantId.hashCode( ) : 0);
        result = 31 * result + (dishId != null ? dishId.hashCode( ) : 0);
        result = 31 * result + (status != null ? status.hashCode( ) : 0);
        result = 31 * result + (dishes != null ? dishes.hashCode( ) : 0);
        return result;
    }

    @Override
    public String toString() {
        return "RestDish{" +
                "id=" + id +
                ", restaurantId=" + restaurantId +
                ", dishId=" + dishId +
                ", status=" + status +
                ", dishes=" + dishes +
                '}';
    }

}
